/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nms.entities;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mohamedemara
 */
@Entity
@Table(name = "ISP_Tele")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ISPTele.findAll", query = "SELECT i FROM ISPTele i"),
    @NamedQuery(name = "ISPTele.findByIspId", query = "SELECT i FROM ISPTele i WHERE i.iSPTelePK.ispId = :ispId"),
    @NamedQuery(name = "ISPTele.findByTele", query = "SELECT i FROM ISPTele i WHERE i.iSPTelePK.tele = :tele")})
public class ISPTele implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ISPTelePK iSPTelePK;

    public ISPTele() {
    }

    public ISPTele(ISPTelePK iSPTelePK) {
        this.iSPTelePK = iSPTelePK;
    }

    public ISPTele(String ispId, String tele) {
        this.iSPTelePK = new ISPTelePK(ispId, tele);
    }

    public ISPTelePK getISPTelePK() {
        return iSPTelePK;
    }

    public void setISPTelePK(ISPTelePK iSPTelePK) {
        this.iSPTelePK = iSPTelePK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iSPTelePK != null ? iSPTelePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ISPTele)) {
            return false;
        }
        ISPTele other = (ISPTele) object;
        if ((this.iSPTelePK == null && other.iSPTelePK != null) || (this.iSPTelePK != null && !this.iSPTelePK.equals(other.iSPTelePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.nms.entities.ISPTele[ iSPTelePK=" + iSPTelePK + " ]";
    }
    
}
